<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Friends.aspx.cs" Inherits="Friends" Title="My Friends" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
 <fs:FriendsterApplication runat="server" ID="fsApplication" ApplicationKey="0c868a9a9f2d332000cd09e1ed602ddc"
    ApplicationName="Creating .NET Client" Secret="7234cc4ad7689d0f8031b2023e252a3d" CallbackUrl="http://localhost:1653/StepByStep/" />
<%
    Response.Write("<div style=\"padding-left:20px\"><strong>My Friends</strong><br /><br />");
    string[] friends = fsApplication.Service.Friends.GetFriends();
    for (int i = 0; i < friends.Length; i++)
    {
        Response.Write(i+1 + ". <a href=Default.aspx?id=" + friends[i] + ">");
        Response.Write(fsApplication.Service.Users.GetUser(friends[i]).Name + "<a><br />");
    }
    Response.Write("</div>");

    Response.Write("<div style=\"padding-left:20px\"><strong>Application Friends</strong><br /><br />");
    string[] appFriends = fsApplication.Service.Friends.AppFriends();
    if (appFriends != null)
    {
        for (int i = 0; i < appFriends.Length; i++)
        {
            Response.Write(i + 1 + ". <a href=Default.aspx?id=" + appFriends[i] + ">");
            Response.Write(fsApplication.Service.Users.GetUser(appFriends[i]).Name + "<a><br />");
        }
    }
    else
    {
        Response.Write("Sorry, None of your friends are currently using your application.");
    }
    Response.Write("</div>");
%>
</asp:Content>

